package com.trippin.servlets;

import java.util.HashMap;
import java.util.Map;

public enum Action {

	GET_LOCATION_ATTRACTIONS("getLocationAttractions"),
	
	GET_ATTRACTION_BY_NAME("getAttractionByName"),
	GET_ATTRACTION_BY_ID("getAttractionById"),
	ATTEND_TO_ATTRACTION("attendToAttraction"),
	UNATTEND_FROM_ATTRACTION("unAttendFromAttraction"),
	CREATE_ATTRACTION("createAttraction"),
	UPDATE_ATTRACTION("updateAttraction"),
	DELETE_ATTRACTION("deleteAttraction"),
	ADD_PLUS_TO_ATTRACTION("addPlusToAttraction"),
	ADD_MINUS_TO_ATTRACTION("addMinusToAttraction"),
	ADD_COMMENT_TO_ATTRACTION("addCommentToAttraction"),
	REMOVE_COMMENT_FROM_ATTRACTION("removeCommentFromAttraction"),
	GET_SCHEDULE_OF_ATTRACTION("getScheduleOfAttraction"),
	
	GET_SCHEDULE_ATTRACTIONS("getScheduleAttractions"),
	ATTEND_TO_SCHEDULE_ATTRACTION("attendToScheduleAttraction"), 
	UNATTEND_FROM_SCHEDULE_ATTRACTION("unattendFromScheduleAttraction"), 
	CREATE_SCHEDULE_ATTRACTION("createScheduleAttraction"),
	ADD_PLUS_TO_SCHEDULE_ATTRACTION("addPlusToScheduleAttraction"),
	ADD_MINUS_TO_SCHEDULE_ATTRACTION("addMinusToScheduleAttraction"),

	GET_ALL_USER_TRIPS("getAllUserTrips"),
	GET_USER_TRIP("getUserTrip"),
	CREATE_TRIP("createTrip"),
	UPDATE_TRIP("updateTrip"),
	DELETE_TRIP("deleteTrip"),
	SEND_TRIP_SHARING_REQUEST("sendTripSharingRequest"), 
	
	GET_USER_PROFILE("getUserProfile"), 
	CREATE_USER_PROFILE("createUserProfile"), 
	UPDATE_USER_PROFILE("updateUserProfile"), 
	
	GET_TRIP_SHARING_REQUESTS("getTripSharingRequests"), 
	ACCEPT_TRIP_SHARING_REQUEST("acceptTripSharingRequest"), 
	DENIED_TRIP_SHARING_REQUEST("deniedTripSharingRequest"), 
	GET_USERS_NEAR_ME("getUsersNearMe"), 
	ATTRACTION_YOU_USER_MAY_LIKE("attractionsYouMayLike"),
	
	GET_STICKY_NOTES_BY_BOUND("getStickyNotesByBound"), 
	CREATE_STICKY_NOTE("createStickyNote"), 
	GET_ALL_USER_STICKY_NOTES("getAllUserStickyNotes"), 
	GET_ALL_STICKY_NOTES_BY_STICKY_NOTE("getAllStickyNotesByStickyNote"), 
	DELETE_STICKY_NOTE("deleteStickyNote");


	private final String name;
	
	private Action(String name) {
		this.name = name;
	}
	
	public String getName() {
		return name;
	}
	
	
	private final static Map<String,Action> actionsNames = new HashMap<String,Action>();

	static {
		actionsNames.put(Action.GET_LOCATION_ATTRACTIONS.getName(), 
				Action.GET_LOCATION_ATTRACTIONS);
		
		actionsNames.put(Action.GET_ATTRACTION_BY_NAME.getName(), 
				Action.GET_ATTRACTION_BY_NAME);
		actionsNames.put(Action.GET_ATTRACTION_BY_ID.getName(), 
				Action.GET_ATTRACTION_BY_ID);
		actionsNames.put(Action.ATTEND_TO_ATTRACTION.getName(), 
				Action.ATTEND_TO_ATTRACTION);
		actionsNames.put(Action.UNATTEND_FROM_ATTRACTION.getName(), 
				Action.UNATTEND_FROM_ATTRACTION);
		actionsNames.put(Action.CREATE_ATTRACTION.getName(), 
				Action.CREATE_ATTRACTION);
		actionsNames.put(Action.UPDATE_ATTRACTION.getName(), 
				Action.UPDATE_ATTRACTION);
		actionsNames.put(Action.DELETE_ATTRACTION.getName(), 
				Action.DELETE_ATTRACTION);
		actionsNames.put(Action.ADD_PLUS_TO_ATTRACTION.getName(), 
				Action.ADD_PLUS_TO_ATTRACTION);
		actionsNames.put(Action.ADD_MINUS_TO_ATTRACTION.getName(), 
				Action.ADD_MINUS_TO_ATTRACTION);
		actionsNames.put(Action.ADD_COMMENT_TO_ATTRACTION.getName(), 
				Action.ADD_COMMENT_TO_ATTRACTION);
		actionsNames.put(Action.REMOVE_COMMENT_FROM_ATTRACTION.getName(), 
				Action.REMOVE_COMMENT_FROM_ATTRACTION);
		actionsNames.put(Action.GET_SCHEDULE_OF_ATTRACTION.getName(), 
				Action.GET_SCHEDULE_OF_ATTRACTION);
						
		actionsNames.put(Action.GET_SCHEDULE_ATTRACTIONS.getName(), 
				Action.GET_SCHEDULE_ATTRACTIONS);
		actionsNames.put(Action.ATTEND_TO_SCHEDULE_ATTRACTION.getName(), 
				Action.ATTEND_TO_SCHEDULE_ATTRACTION);
		actionsNames.put(Action.UNATTEND_FROM_SCHEDULE_ATTRACTION.getName(), 
				Action.UNATTEND_FROM_SCHEDULE_ATTRACTION);
		actionsNames.put(Action.CREATE_SCHEDULE_ATTRACTION.getName(), 
				Action.CREATE_SCHEDULE_ATTRACTION);
		actionsNames.put(Action.ADD_PLUS_TO_SCHEDULE_ATTRACTION.getName(), 
				Action.ADD_PLUS_TO_SCHEDULE_ATTRACTION);
		actionsNames.put(Action.ADD_MINUS_TO_SCHEDULE_ATTRACTION.getName(), 
				Action.ADD_MINUS_TO_SCHEDULE_ATTRACTION);

		actionsNames.put(Action.GET_ALL_USER_TRIPS.getName(), 
				Action.GET_ALL_USER_TRIPS);
		actionsNames.put(Action.GET_USER_TRIP.getName(), 
				Action.GET_USER_TRIP);
		actionsNames.put(Action.CREATE_TRIP.getName(), 
				Action.CREATE_TRIP);
		actionsNames.put(Action.UPDATE_TRIP.getName(), 
				Action.UPDATE_TRIP);
		actionsNames.put(Action.DELETE_TRIP.getName(), 
				Action.DELETE_TRIP);
		actionsNames.put(Action.SEND_TRIP_SHARING_REQUEST.getName(), 
				Action.SEND_TRIP_SHARING_REQUEST);
		
		actionsNames.put(Action.GET_USER_PROFILE.getName(), 
				Action.GET_USER_PROFILE);
		actionsNames.put(Action.CREATE_USER_PROFILE.getName(), 
				Action.CREATE_USER_PROFILE);
		actionsNames.put(Action.UPDATE_USER_PROFILE.getName(), 
				Action.UPDATE_USER_PROFILE);
		
		actionsNames.put(Action.GET_TRIP_SHARING_REQUESTS.getName(), 
				Action.GET_TRIP_SHARING_REQUESTS);
		actionsNames.put(Action.ACCEPT_TRIP_SHARING_REQUEST.getName(), 
				Action.ACCEPT_TRIP_SHARING_REQUEST);
		actionsNames.put(Action.DENIED_TRIP_SHARING_REQUEST.getName(), 
				Action.DENIED_TRIP_SHARING_REQUEST);
		actionsNames.put(Action.GET_USERS_NEAR_ME.getName(), 
				Action.GET_USERS_NEAR_ME);
		actionsNames.put(Action.ATTRACTION_YOU_USER_MAY_LIKE.getName(), 
				Action.ATTRACTION_YOU_USER_MAY_LIKE);
		
		actionsNames.put(Action.GET_STICKY_NOTES_BY_BOUND.getName(), 
				Action.GET_STICKY_NOTES_BY_BOUND);
		actionsNames.put(Action.CREATE_STICKY_NOTE.getName(), 
				Action.CREATE_STICKY_NOTE);
		actionsNames.put(Action.GET_ALL_USER_STICKY_NOTES.getName(), 
				Action.GET_ALL_USER_STICKY_NOTES);
		actionsNames.put(Action.GET_ALL_STICKY_NOTES_BY_STICKY_NOTE.getName(), 
				Action.GET_ALL_STICKY_NOTES_BY_STICKY_NOTE);
		actionsNames.put(Action.DELETE_STICKY_NOTE.getName(), 
				Action.DELETE_STICKY_NOTE);
	}
	
	public static Action getActionByName(String name) {
		return actionsNames.get(name);
	}

}
